
;(function ($) {
	var _setting = {
		fileUrl:null,
		fileName:null,
		page:1,
		//`[zoom],[left],[top]`, `page-width`, `page-height`, `page-fit`, `auto` or number
		zoom:'auto'
		
	};
	var UrlPath ="";
    $.fn.pdfView = function (options) {
    	var obj = $(this);
		var opts = $.extend({}, _setting, options);
		if(!opts.fileUrl){
			console.error("必须设置文件流路径！");
			throw new TypeError("the fileUrl is Null!");
		}
		
		UrlPath +=top.locat+"/pdf/view.do";
		if(opts.fileName){
			UrlPath += "?file="+encodeURIComponent(top.locat+"/"+opts.fileUrl+"&filename="+opts.fileName+".pdf");
		}else{
			UrlPath += "?file="+encodeURIComponent(top.locat+"/"+opts.fileUrl);
		}
		UrlPath +="#page="+opts.page+"&zoom="+opts.zoom;
		obj.empty().append("<iframe  src='"+UrlPath+"' width=\"100%\" height=\"100%\" scrolling=\"auto\" ></iframe>");
    };
})(jQuery);